import React, { Component } from 'react'

import './Login.css'

export default class Login extends Component {
    constructor(props) {
        super(props)
        this.state = {
            name: 'luyaoa',
            age: 10,
            list: [{
                    name: 'name1',
                    age: 7,
                    id: 1
                },
                {
                    name: 'name2',
                    age: 2,
                    id: 2
                },
            ]
        }
    }

    // 测试函数
    fntest(key) {
        console.log(key)
        console.log(this.state.name)
    }



    render() {
        return (
            <div className='list'>
                <li className='item' onClick={this.fntest.bind(this,'123')}>
                {this.state.age>5?'哇你有五岁大哦':'你还小哦'}
                </li>
            </div>
        )
    }

}